package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.RecommendUser;
import com.tanhua.model.mongo.Visitors;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
public class UserLikeVo implements Serializable {
    private Integer id; //用户id
    private String nickname; //昵称
    private String avatar; //用户头像
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String education; //学历
    private Integer marriage; //婚姻状态

    private Integer matchRate; //匹配度
    private Boolean alreadyLove; //是否喜欢ta

    public static UserLikeVo init(UserInfo userInfo, Visitors visitors) {
        UserLikeVo vo = new UserLikeVo();
        BeanUtils.copyProperties(userInfo,vo);
        vo.setId(userInfo.getId().intValue());
        if (visitors != null) {
            vo.setMatchRate(visitors.getScore().intValue());
        }
        return vo;
    }

}
